﻿--2 - Найти контакты всех Pigida

select P.[LastName], P.[Name], C.[ContactType], C.[ContactValue]
	from [MyFamily].[dbo].[Persons] as P, [MyFamily].[dbo].[Contact] as C
	where (P.[ID] = C.[fk_PersonID] and P.[LastName] = 'Pigida')

select [ContactType], [ContactValue]
from [MyFamily].[dbo].[Contact] as E1
where EXISTS(
select [LastName], [Name]
from [MyFamily].[dbo].[Persons] as E2
where (E1.[fk_PersonId] = E2.[ID] and E2.[LastName]='Pigida'));